
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<script type="text/javascript">
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
</script>
    <div class="content-wrap">
        <div class="wrapper" style="bottom: 50px;">
            <ul class="nav nav-tabs">
                <li class="active">
                    <a href="#"   onclick="loadDiv('priceRightDiv','${ctx}/drug/drugPrice/index?drugInfo.drugDict.drugCode=${drugPrice.drugInfo.drugDict.drugCode}')">药品价格列表</a>
                </li>
                <li>
                    <a href="#" onclick="loadDiv('priceRightDiv','${ctx}/drug/drugPrice/form?drugInfo.drugDict.drugCode=${drugPrice.drugInfo.drugDict.drugCode}')">药品价格添加</a>
                </li>
            </ul>
            <section class="panel panel-default">
                <div class="panel-body">
                    <div class="table-responsive no-border">
                        <div class="datatable-top">
                            <div class="pull-left">
                            	<form:form id="searchPriceForm" modelAttribute="drugPrice"  onsubmit="return loadDivForm('priceRightDiv','searchPriceForm','${ctx}/drug/drugPrice/index');" method="post" class="form-inline">
                                    <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
                                    <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
                                    <label>药品代码 ：</label><form:input path="drugInfo.drugDict.drugCode" htmlEscape="false" maxlength="50" class="form-control" />
                                    &nbsp;&nbsp;<label>药品名称 ：</label><form:input path="drugInfo.drugDict.drugName" htmlEscape="false" maxlength="50" class="form-control" />
                                    <%--<form:select path="stopFlag" htmlEscape="false" maxlength="50" class="form-control" >--%>
                                        <%--<form:option value=""/>--%>
                                        <%--<form:options items="${fns:getDictList('STOP_FLAG')}" itemLabel="label" itemValue="value" htmlEscape="false"/>--%>
                                    <%--</form:select>--%>
                                    <input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>

                                </form:form>
                            </div>
                        </div>
                        <table id="contentTable" class="table table-bordered mg-t datatable">
                            <thead>
                                <tr>
                                    <th>药品代码</th>
                                    <th>药品名称</th>
                                    <th>包装规格</th>
                                    <th>药品单位</th>
                                    <th>药品厂商</th>
                                    <th>批发价/元</th>
                                    <th>零售价/元</th>
                                    <th>起用日期</th>
                                 <%--   <th>费用分类</th>
                                    <th>核算项目分类</th>
                                    <th>会计科目</th>
                                    <th>病案首页分类</th>--%>
                                    <th>最高限价/元</th>
                                    <th>停价时间</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody>
                            <c:forEach items="${page.list}" var="drugPrice" varStatus="stopPrice">
                                <tr id="stopTr${stopPrice.index}">
                                    <td> ${drugPrice.drugInfo.drugDict.drugCode}</td>
                                    <td> ${drugPrice.drugInfo.drugDict.drugName}</td>
                                    <td> ${drugPrice.packageSpec}</td>
                                    <td> ${fns:getDictLabels(drugPrice.units, 'SPEC_UNIT', '')}</td>
                                    <td> ${drugPrice.drugInfo.drugSupplierCata.supplierName}</td>
                                    <td> ${drugPrice.tradePrice}</td>
                                    <td> ${drugPrice.retailPrice}</td>
                                    <td> <fmt:formatDate value="${drugPrice.startDate}" pattern="yyyy-MM-dd HH:mm:ss"></fmt:formatDate></td>
                                 <%--   <td> ${fns:getDictLabels(drugPrice.classOnRcpt, 'RECK_ITEM_CLASS_DICT', '')}</td>
                                    <td> ${fns:getDictLabels(drugPrice.classOnReckoning, 'RECK_ITEM_CLASS_DICT', '')}</td>
                                    <td> ${fns:getDictLabels(drugPrice.subjCode, 'TALLY_SUBJECT_DICT', '')}</td>
                                    <td> ${drugPrice.classOnMr}</td>--%>
                                    <td> ${drugPrice.priceMax}</td>
                                    <td> <fmt:formatDate value="${drugPrice.stopDate}" pattern="yyyy-MM-dd HH:mm:ss"></fmt:formatDate></td>
                                    <td>
                                        <a href="#" onclick="basePrice('确认要生成药品的基本价格吗？','priceRightDiv','${ctx}/drug/drugPrice/basicPrice?id=${drugPrice.id}','${ctx}/drug/drugPrice/index?drugInfo.drugDict.drugCode=${drugPrice.drugInfo.drugDict.drugCode}')" class="btn btn-primary btn-xs">生成基本价格</a>
                                       <%-- <a href="#" onclick="loadDiv('priceRightDiv','${ctx}/drug/drugPrice/form?id=${drugPrice.id}')" class="btn btn-success btn-xs">修改</a>--%>
                                        <a href="#" class="btn btn-danger btn-xs" id="stopA${stopPrice.index}" onclick="basePrice('您确认要停用该药品吗？','priceRightDiv','${ctx}/drug/drugPrice/stopPrice?id=${drugPrice.id}',
                                                '${ctx}/drug/drugPrice/index?drugInfo.drugDict.drugCode=${drugPrice.drugInfo.drugDict.drugCode}')">停价</a>
                                    </td>
                                </tr>
                            <script>
                                if('${drugPrice.stopDate}'!=''){
                                    $("#stopA${stopPrice.index}").css("display","none");
                                    $("#stopTr${stopPrice.index}").css("backgroundColor","#CAD4CF");
                                }
                            </script>
                            </c:forEach>

                        </table>
                        <div class="pagination">${page}</div>
                    </div>
                </div>
            </section>
        </div>
    </div>